<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:th="http://www.thymeleaf.org"
>
<head th:include="common/common :: jscss2">
    <title>试点配置/渠道配置</title>
</head>
<body>
<div class="layui-fluid">

    <blockquote class="layui-crumb">
        试点配置/渠道配置
    </blockquote>

    <div class="layui-card">
        <div class="layui-tab layui-tab-brief">
            <ul class="layui-tab-title">
                <li class="layui-this"><a
                        th:href="|/pilot/channel/price/addEditView.action?channelPriceId=${channelPriceVO.channelPriceId}|"
                        lay-text="配置信息">基本信息</a></li>
                <li th:if="${channelPriceVO.channelPriceId > 0}"><a
                        th:href="|/pilot/channel/price/serviceCategory.action?configId=${channelPriceVO.channelPriceId}&type=1&showType=2|"
                        lay-text="应用分类">应用分类</a></li>
            </ul>
        </div>

        <div class="layui-card-body">
            <form method="POST" action="" class="layui-form" lay-filter="zmn-form">

                <input type="hidden" name="channelPriceId" id="channelPriceId"
                       th:value="${channelPriceVO.channelPriceId}"/>

                <div class="layui-card-header layui-margin-b"><b></b></div>

                <div class="layui-form-item" th:if="${channelPriceVO.channelPriceId > 0}">
                    <label class="layui-form-label">ID：</label>
                    <div class="layui-input-block">
                        <div class="layui-form-mid">
                            <span th:text="${channelPriceVO.channelPriceId}">ID</span>
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">试点类型</label>
                    <div class="layui-input-block" style="width: 50%;">
                        <select name="type" id="type" lay-verify="required" disabled="disabled" lay-search>
                            <option value="">请选择</option>
                            <option th:each="type:${typeList}" th:value="${type.key}"
                                    th:text="${type.value}"
                                    th:selected="${type.key == channelPriceVO.type}"/>
                        </select>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">
                        请选择渠道
                    </label>
                    <div class="layui-input-block" style="width: 50%;">
                        <div id="channelIds"></div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">执行城市</label>
                    <div class="layui-input-inline">
                        <select name="provinceId" id="provinceId" lay-filter="provinceId" lay-search>
                            <option value="0">省份</option>
                            <option th:each="province:${baseAreaList}" th:value="${province.value}"
                                    th:text="${province.text}"/>
                        </select>
                    </div>
                    <div class="layui-input-inline">
                        <select name="cityId" id="cityId" lay-filter="cityId" lay-search>
                            <option value="0">城市</option>
                        </select>
                    </div>
                    <button class="layui-btn" id="addCity">添加</button>
                    <span style="color: #9F9F9F; padding-left: 5px">城市支持选择多个</span>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label"></label>
                    <div class="layui-input-block" style="width: 50%;">
                        <div style="min-height: 100px;border: 1px solid #ccc;padding: 5px;"
                             id="addCityDiv">
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">不执行城市</label>
                    <div class="layui-input-inline">
                        <select name="provinceId1" id="provinceId1" lay-filter="provinceId1" lay-search>
                            <option value="0">省份</option>
                            <option th:each="province:${baseAreaList}" th:value="${province.value}"
                                    th:text="${province.text}"/>
                        </select>
                    </div>
                    <div class="layui-input-inline">
                        <select name="cityId1" id="cityId1" lay-filter="cityId1" lay-search>
                            <option value="0">城市</option>
                        </select>
                    </div>
                    <button class="layui-btn" id="addCity1">添加</button>
                    <span style="color: #9F9F9F; padding-left: 5px">如不选择，除配置城市默认不执行配置</span>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label"></label>
                    <div class="layui-input-block" style="width: 50%;">
                        <div style="min-height: 100px;border: 1px solid #ccc;padding: 5px;"
                             id="addCityDiv1">

                        </div>
                    </div>
                </div>

                <zmn th:if="${channelPriceVO.type == 1}">
                    <div class="layui-form-item">
                        <label class="layui-form-label layui-form-required">选择支付方式</label>
                        <div class="layui-input-block">
                            <input th:each="payType:${payTypeList}" type="radio" name="payType"
                                   th:value="${payType.key}"
                                   th:checked="${payType.key == channelPriceVO.payType}" th:title="${payType.value}"
                                   lay-verify="required|payType" lay-filter="payType">
                        </div>
                    </div>

                    <div id="setDeposit" style="display: none">
                        <div class="layui-form-item">
                            <label class="layui-form-label layui-form-required">是否设置定金</label>
                            <div class="layui-input-block">
                                <input type="radio" th:each="deposit:${depositList}" name="depositStatus"
                                       lay-filter="depositStatus" th:value="${deposit.key}"
                                       th:title="${deposit.value}"
                                       lay-verify="required"
                                       th:checked="${deposit.key} == ${channelPriceVO.depositStatus}">
                            </div>
                        </div>

                        <div id="depositBlock" style="display: none">
                            <div class="layui-form-item">
                                <label class="layui-form-label">定金</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input" name="deposit" id="deposit"
                                           placeholder="请输入正整数，100以内" lay-verify="maxSix"
                                           title="设置定金">
                                </div>
                                <span> 元 <span style="color: #9F9F9F;"> 如不设置定金执行支付原价</span></span>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label layui-form-required">是否设置定金抵扣</label>
                                <div class="layui-input-block">
                                    <input type="radio" th:each="deposit:${depositList}" name="depositDeductionStatus"
                                           lay-filter="depositDeductionStatus" th:value="${deposit.key}"
                                           th:title="${deposit.value}"
                                           lay-verify="required"
                                           th:checked="${deposit.key == channelPriceVO.depositDeductionStatus}">
                                </div>
                            </div>
                            <div class="layui-form-item" th:hidden="${channelPriceVO.depositDeductionStatus!=2}" id="depositDeductionAmountBlock">
                                <label class="layui-form-label">定金抵扣金额</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input" name="depositDeductionAmount" id="depositDeductionAmount"
                                           placeholder="请输入正整数"
                                           title="设置定金抵扣金额">
                                </div>
                                <span> 元 <span style="color: #9F9F9F;"> 如不设置则表示定金不能抵扣更多金额</span></span>
                            </div>
                        </div>
                    </div>

                </zmn>
                <div class="layui-form-item layui-layout-admin">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0;text-align: left;padding-left: 25%;">
                            <button class="layui-btn" lay-submit="" lay-filter="zmn-form-submit"
                                    th:text="${channelPriceVO.channelPriceId > 0 ? '提交' : '下一步' }"
                            ></button>
                            <button class="layui-btn layui-btn-primary"
                                    onclick="zmnLayUtil.closeThisTabs()">
                                取消
                            </button>
                        </div>
                    </div>
                </div>

            </form>
        </div>
    </div>

</div>
<script type="text/javascript" th:inline="javascript">
    var json = {
        channelPriceVO: [[${channelPriceVO}]],
        baseAreaList: [[${baseAreaList}]],
        onePriceList: [[${onePriceList}]],
        channelList: [[${channelList}]],
        basePriceList: [[${basePriceList}]]
    };
    layui.config({
        version: 201908070942,
        base: "/static/lay/"
    }).extend({
        index: "lib/index",
        channel_price_edit_js: "pilot/zmn.plat.channel.price.edit"
    }).use(['index', 'channel_price_edit_js']);
</script>
</body>
</html>